<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>window窗口</title>
		<style type="text/css">
		#guanggao{
			position: fixed;
			top: 0;
			left: 0;
			height: 800px;
			width: 1200px;
			background-color: brown;
			display: none;
		}
		</style>
		<script>
		 //alert(typeof(window));
		 function showWin(){
			 //alert(window.height+"*"+window.width+"外层大小");
			 alert(window.outerHeight+"*"+window.outerWidth+"外层大小");
			 alert(window.innerHeight+"*"+window.innerWidth+"内层大小");
			 alert("窗口左上角的位置："+window.screenX+"*"+window.screenY);
		 }
		 function closeWin(){
			 if(window.confirm("真的关闭？")){
				 window.close();
			 }
		 }
		 function openWin(){
			 window.open("http://www.bdqn.cn","北大青鸟总部","toolbar=no,height=400,width=300,left=400px,top=150px");
		 }
		 function opendiv(){
			 window.document.getElementById("guanggao").style.display="block";
		 }
		 function rtnBack(){
			 window.history.back();
		 }
		 function showLoc(){
			 alert(window.location);
			 alert("host:"+window.location.host);
			 alert("host:"+window.location.hostname);
			 alert("host:"+window.location.href);
		 }
		 function newWin(){
			 window.location.replace("http://www.bdqn.cn");
		 }
		 function showDoc(){
			 window.document.title=window.prompt("新窗口标题：");
			 alert(window.document.URL);
			 alert("从哪里来的？"+window.document.referrer);
			 alert("最后修改时间："+document.lastModified);
			 
		 }
		</script>
	</head>
	<body>
		<input type="button" value="窗口信息" onclick="showWin()"/>
		<input type="button" value="关闭窗口" onclick="closeWin()"/>
		<input type="button" value="弹出广告" onclick="openWin()"/>
		<input type="button" value="弹出div广告" onclick="opendiv()"/>
		<input type="button" value="返回" onclick="rtnBack()"/>
		
		<input type="button" value="获得location信息" onclick="showLoc()"/>
		<input type="button" value="刷新" onclick="window.location.reload()"/>
		<input type="button" value="新窗口" onclick="newWin()"/>
		<input type="button" value="文档窗口" onclick="showDoc()"/>
		<div id="guanggao">
			 <h1>一刀999！！！</h1>
		</div>
	</body>
</html>
